<template>
  <div>
    <h2>v-model的原理</h2>
    <!-- 对于输入框来说：v-model相当于：value+@input事件 -->
    <!-- <input type="text" :value="uname" @input="uname = $event.target.value"> -->

    <!-- 对于输入框来说：v-model相当于：checked+@change事件 -->
    <!-- <input type="checkbox" :checked="flag" @change="flag = $event.target.checked"> -->
    <my-input :value="uname" @input="val=>uname=val"></my-input>
  </div>
</template>

<script>
import MyInput from './components/MyInput.vue';
export default {
  components: { MyInput },
  data(){
    return{
      uname:'zhangsan',
      flag:true
    }
  }
};
</script>

<style></style>
